package com.bing.bingPro.service;

import com.bing.bingPro.entity.VendorEmailEntity;
import com.bing.bingPro.mapper.VendorEmailMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class VendorEmailService {
    private final VendorEmailMapper vendorEmailMapper;

    public VendorEmailService(VendorEmailMapper vendorEmailMapper) {
        this.vendorEmailMapper = vendorEmailMapper;
    }

    public String getVendorEmail(String vendor) {
        VendorEmailEntity one = vendorEmailMapper.findOne(vendorEmailMapper.query().where.vendor().eq(vendor).end());
        return one.getVdContactMailbox();
    }

}
